﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Zeus.Thunder.Core;
using System.ServiceModel;
using System.ServiceModel.Web;
using Perseus.WCF.REST.Contract.Data;
using System.Configuration;


namespace Perseus.WCF.REST.Client.Basic
{
    class HelloTest : ITestCase
    {
        public void Run()
        {
            Console.Write("Please Input Your Name: ");
            string name = Console.ReadLine();
            Console.Write("Please Input Your Age: ");
            string age = Console.ReadLine();

            string url = ConfigurationManager.AppSettings["helloUrl"];

            using (WebChannelFactory<IHelloService> wcf
                = new WebChannelFactory<IHelloService>(new Uri(url)))
            {
                var channel = wcf.CreateChannel();
                EmpData emp = channel.HelloXml(name, age);
                Console.WriteLine(emp.Name);
                Console.WriteLine(emp.Age);
            }
        }
    }
}
